<template>
	<view class="p-40 bg-white" @click="openitem">
		
	
	<view class="content flex " v-if="item.record.length!=0">
		<view class="avatar flex-content">
			<image :src="item.driver_avatar" mode="widthFix"></image>
		</view>
		<view class="right-content flex col-center"  >
			<view class="" style="width: 100%;">
				
			
			<view class="name-msg m-l-24 ">
				<view class="flex row-between">
					
				
				<view class="xxl bold">
					{{item.driver_name}}
				</view>
				<view class="msg-content ">
					<view class="time-content" style="color: #BFBEBE ;">
						{{item.record[0].create_time.slice(5, 7)}}月
						{{item.record[0].create_time.slice(8, 11)}}日
						{{item.record[0].create_time.slice(11, 16)}}
					</view>
				</view>
				</view>
			</view>
			<view class="time-num m-l-24 flex row-between col-center m-t-12">
				
				<view class="msg-content" v-if="item.record[0].type==2">
					[图片]
				</view>
				<view class="msg-content" v-if="item.record[0].type==6">
					[地址]
				</view>
				<view class="msg-content line-1" style="border: 400rpx;" v-if="item.record[0].type==1">
					{{item.record[0].message}}
				</view>
			
					<view class="msg-content" v-if="item.record[0].type==3">
						[视频]
					</view>
						<view class="num-content flex-content " v-if="item.record_count!=0">
							{{item.record_count}}
					</view>
					
				
			</view>
			
		</view>
		</view>
	</view>
	</view>
</template>

<script>
	export default {
		name:"message-list",
		props:{
			item:{
				type:Object,
				default:()=>{}
			}
		},
		data() {
			return {
				
			};
			
			},
			methods:{
				openitem(){
						uni.navigateTo({
										url:`/pages/chat_detail/chat_detail?order_id=${this.item.order_id}&user_id=${this.item.record[0].user_id}&im_id=${this.item.record[0].im_id}&dr_name=${this.item.driver_name}`
									})
					// console.log(`/pages/chat_detail/chat_detail?order_id=${this.item.order_id}&user_id=${this.item.record[0].user_id}&im_id=${this.item.driver_nickname}`);
				}
		}
	}
</script>

<style lang="scss" scoped>
.content{
	height: 168rpx;
	
}
.right-content{
	width:570rpx;
	height: 168rpx;
	border-bottom: 2rpx solid #EAEAEA;
}
.avatar{
	width: 104rpx;
	height: 104rpx;
	border-radius: 200rpx;
	overflow: hidden;
	image{
		width: 100%;
	}
}
.msg-content{
	color: #807F7F;
}
.name-msg{
	
	
}
.time-num {

}
.num-content{
	 min-width: 44rpx;
	min-height: 44rpx;
	color: #FFFFFF;
	
	border-radius: 100rpx;
	background-color: #E85631;
}
</style>
